package org.flowers.unbeaten.logging.async;

import org.flowers.unbeaten.base.entity.Log;
import org.flowers.unbeaten.base.service.IBaseService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @description 日志异步工厂
 * @author RyanWang
 * @date 2021-08-02 17:39:46
 * @version 1.0
 */
@Service
public class LoggingFactory {

    /**
     * 引入日志服务
     */
    @Resource
    private IBaseService baseService;

    /**
     * 执行日志入库操作
     * @param log
     */
    @Async
    public void insertLog(Log log) {
        baseService.save(log);
    }
}
